function hhi = Compute_HHI(X)

%%%% This function computes the Hirschmann-Herfindahl Index across the rows
%%%% of matrix X.

total = sum(X')';

X = X./repmat(total,1,size(X,2));

hhi = sum((X.^2)')';

end

